package com.c.result;

import java.util.Map;

import flexjson.JSONSerializer;

public class MapResult<a extends Map> extends BaseResult<a> {
	private static final long serialVersionUID = 1907895332020727778L;
	/** JSON Serializer */
	private JSONSerializer _jsonSer = new JSONSerializer().include("data");

	private Map data;

	public Map getData() {
		return data;
	}

	public void setData(Map data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return _jsonSer.serialize(this);
	}

	@Override
	public MapResult appendJsonIncludes(String... propNames) {
		for (String propName : propNames) {
			_jsonSer.include(propName);
		}
		return this;
	}

	@Override
	public MapResult appendJsonExcludes(String... propNames) {
		for (String propName : propNames) {
			_jsonSer.exclude(propName);
		}
		return this;
	}
}
